package JavaStudy.test;

public class tryCatchFinally {

    public static int show() {
        try {
            throw new MyException1extends("这是自定义的异常,不必紧张");
        }catch (Exception e){
            e.printStackTrace();
        }
        finally{
            System.out.println("finally模块被执行");
        }
        System.out.println("D");
        return 1;
    }
    //自定义异常：
    public static class MyException1extends extends Exception {
        public MyException1extends(String msg){
            super(msg);
        }
    }

    public static void main(String[] args) {
        System.out.println(show());
    }
}
